home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Almathera Ten Pack 3: CDPD 3
/
Almathera Ten on Ten - Disc 3: CDPD3.iso
/
scope
/
051-075
/
scopedisk61
/
loadiff
/
picload
< prev
next >
Wrap
Text File
|
1995-03-19
|
2KB
|
70 lines
'* This is just a short demo of the iff.lib being accessed
'* from AmigaBasic. I only was interested in loading a picture
'* that I knew was the size and depth of the window I was using.
'* To show any picture check format with GetBHTD, then open the
'* screen and window.
'* J.R.Boyd 1/16/89
SCREEN 1,640,200,3,2
WINDOW 2,"MyWindow",,22,1
DECLARE FUNCTION OpenIFF& LIBRARY
DECLARE FUNCTION GetBMHD& LIBRARY
DECLARE FUNCTION GetColorTab& LIBRARY
DECLARE FUNCTION DecodePic& LIBRARY
DECLARE FUNCTION IffError& LIBRARY
LIBRARY "iff.library"
LIBRARY "graphics.library"
CLS
LOCATE 10,10
PRINT "Input the name of a 640x200 picture"
LOCATE 12,10
INPUT "FileName: ";filename$
filename$=filename$+CHR$(0)
iff& = OpenIFF&(SADD(filename$))
IF iff&=0 THEN
LOCATE 14,10
Er& = IffError&
IF Er& = 16 THEN
PRINT "File not found!!"
ELSEIF Er& = 18 THEN
PRINT "Not enough free RAM!!"
ELSE
PRINT "Iff Error #";Er&
END IF
GOTO BadQuit
END IF
'If you don't know the width,height,depth,mode
'bmhd& = GetBMHD&(iff&)
'IF bmhd& = 0 THEN
' PRINT "cant find bit map header"
' STOP
' END IF
sWindow& = WINDOW(7)
sScreen& = PEEKL(sWindow& + 46&)
sViewPort& = sScreen& + 44&
sRastPort& = sScreen& + 84&
sColorMap& = PEEKL(sViewPort& + 4&)
ColorTab& = PEEKL(sColorMap& +4&)
sBitMap&=PEEKL(sRastPort& + 4&)
Colr& = GetColorTab&(iff&,ColorTab&)
CALL LoadRGB4&(sViewPort&,ColorTab&,Colr&)
Bmp& = DecodePic&(iff&,sBitMap&)
CALL CloseIFF&(iff&)
BadQuit:
'Show the picture for awhile
FOR I=1 TO 10000:NEXT I
WINDOW CLOSE 2
SCREEN CLOSE 1
LIBRARY CLOSE